﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WRJ
{
	public partial class BaseUserControl :UserControl
	{
		/// <summary>
		/// 物品旋转一周需要的时间，单位ms
		/// </summary>
		public double CIRCLE_TIME = 2500;
		/// <summary>
		/// 物品缩放和移动所需要的时间，单位ms
		/// </summary>
		public double MOVE_TIME = 1000;
		/// <summary>
		/// 物体旋转的精细程度，越高效果越好，但消耗资源越大
		/// </summary>
		public int ROTATE_SMOOTH = 180;
		/// <summary>
		/// 物体移动的精细程度，越高效果越好，但消耗资源越大
		/// </summary>
		public int MOVE_SMOOTH = 120;
		/// <summary>
		/// 物体的放大次数
		/// </summary>
		public int TURN_TIMES = 50;
		/// <summary>
		/// 当前场景的中心坐标，X坐标
		/// </summary>
		public double CENTER_X = 50;
		/// <summary>
		/// 当前场景的中心坐标，Y坐标
		/// </summary>
		public double CENTER_Y = 100;
		/// <summary>
		/// 当前场景的中心坐标，Z坐标
		/// </summary>
		public double CENTER_Z = 70;
		/// <summary>
		/// 物体旋转之前和之后是否需要移动和缩放
		/// </summary>
		public int SIZEABLE = 0;
		
		public string ChangeEventName="Change";
		
		/// <summary>
		/// 基用户控件的构造函数
		/// </summary>
		/// 
		public BaseUserControl()
		{
			InitializeComponent();
			AutoSetControlSize();
			BaseCommonClass.SetFont(Tips);
		}
		/// <summary>
		/// 根据窗体的大小，自动调整用户控件的大小
		/// </summary>
		public void AutoSetControlSize()
		{
			this.Size = new Size(Convert.ToInt32(Index.ControlWidth * (Index.SidePercent + Index.CenterPercent)),
								Index.ControlHeight);
			axCult3DP1.Size = new Size(Convert.ToInt32(Index.ControlWidth * Index.CenterPercent), Index.ControlHeight);
			axCult3DP1.Location = new Point(0, 0);
			
			RightPanel.Size = new Size(Convert.ToInt32(Index.ControlWidth * Index.SidePercent), Index.ControlHeight);
			RightPanel.Location = new Point(Convert.ToInt32(Index.ControlWidth * Index.CenterPercent/(Index.CenterPercent+Index.SidePercent)), 0);
			
			Tips.Size = new Size(Convert.ToInt32(Index.ControlWidth * Index.SidePercent),Convert.ToInt32(Index.ControlHeight *Index.RightSidePercent));
			Tips.Location =RightPanel.Location;

			RightDownPanel.Size = new Size(Convert.ToInt32(Index.ControlWidth * Index.SidePercent), Convert.ToInt32(Index.ControlHeight * (1-Index.RightSidePercent)));
			RightDownPanel.Location = new Point(Convert.ToInt32(Index.ControlWidth * Index.CenterPercent), Convert.ToInt32(Index.ControlHeight * Index.RightSidePercent)); 
		}
	}
}
